<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>轮回之牢: D:/Code/cProgram/CPP/Qt/TeamCurriculumDesign/Utils/Math/Rectangle.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">轮回之牢<span id="projectnumber">&#160;0.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_80876d1476b72d92a9650b7ee3516e4c.html">TeamCurriculumDesign</a></li><li class="navelem"><a class="el" href="dir_3e04d676d81597a8e4919b52d418897c.html">Utils</a></li><li class="navelem"><a class="el" href="dir_5067166f79edd3166fef292012c9793b.html">Math</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">Rectangle.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">//</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment">// Created by lenovo on 2021/8/19.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment">//</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#ifndef TEAMCURRICULUMDESIGN_RECTANGLE_H</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#define TEAMCURRICULUMDESIGN_RECTANGLE_H</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &quot;Point.h&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="class_rectangle.html">   13</a></span><span class="keyword">class </span><a class="code hl_class" href="class_rectangle.html">Rectangle</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span>    <span class="comment">//矩形的四个顶点</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>    <a class="code hl_class" href="class_point.html">Point</a> lower_left, upper_left, lower_right, upper_right;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>    <span class="keywordtype">double</span> <a class="code hl_function" href="class_rectangle.html#a0d38078e09cd3151d3009eed3a449660">getWidth</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span>    <span class="keywordtype">double</span> <a class="code hl_function" href="class_rectangle.html#ae2fb8da7f67a36a80d8f789eec63a074">getHeight</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    <a class="code hl_function" href="class_rectangle.html#a87f41c3f204a8977f9f7556b1816a5fa">Rectangle</a>(<span class="keyword">const</span> <a class="code hl_class" href="class_point.html">Point</a> &amp;lower_left, <span class="keywordtype">double</span> width, <span class="keywordtype">double</span> height);</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="class_rectangle.html#a1c76e49430d4d6a878907e7bcee70da2">   41</a></span>    <span class="keyword">enum</span> <a class="code hl_enumeration" href="class_rectangle.html#a1c76e49430d4d6a878907e7bcee70da2">SpiltRegion</a> {</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>        UPPER_LEFT,<span class="comment">//左上</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>        UP,<span class="comment">//上</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>        UPPER_RIGHT,<span class="comment">//右上</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>        LEFT,<span class="comment">//左</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>        INSIDE,<span class="comment">//内部</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>        RIGHT,<span class="comment">//右</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>        LOWER_LEFT,<span class="comment">//左下</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>        DOWN,<span class="comment">//下</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>        LOWER_RIGHT,<span class="comment">//右下</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    };</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>    <a class="code hl_enumeration" href="class_rectangle.html#a1c76e49430d4d6a878907e7bcee70da2">SpiltRegion</a> <a class="code hl_function" href="class_rectangle.html#adceaf832dba90e2fd4b08e7ba6aadef5">getPointRegion</a>(<span class="keyword">const</span> <a class="code hl_class" href="class_point.html">Point</a> &amp;pos) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="class_rectangle.html#a7280e33fa98d1d19f04020dacedddc5e">hasOverlapWith</a>(<span class="keyword">const</span> <a class="code hl_class" href="class_rectangle.html">Rectangle</a> &amp;other) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>};</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span><span class="preprocessor">#endif </span><span class="comment">//TEAMCURRICULUMDESIGN_RECTANGLE_H</span></div>
<div class="ttc" id="aclass_point_html"><div class="ttname"><a href="class_point.html">Point</a></div><div class="ttdoc">二维点</div><div class="ttdef"><b>Definition:</b> Point.h:18</div></div>
<div class="ttc" id="aclass_rectangle_html"><div class="ttname"><a href="class_rectangle.html">Rectangle</a></div><div class="ttdoc">矩形</div><div class="ttdef"><b>Definition:</b> Rectangle.h:13</div></div>
<div class="ttc" id="aclass_rectangle_html_a0d38078e09cd3151d3009eed3a449660"><div class="ttname"><a href="class_rectangle.html#a0d38078e09cd3151d3009eed3a449660">Rectangle::getWidth</a></div><div class="ttdeci">double getWidth() const</div><div class="ttdoc">获取矩形宽度</div><div class="ttdef"><b>Definition:</b> Rectangle.cpp:14</div></div>
<div class="ttc" id="aclass_rectangle_html_a1c76e49430d4d6a878907e7bcee70da2"><div class="ttname"><a href="class_rectangle.html#a1c76e49430d4d6a878907e7bcee70da2">Rectangle::SpiltRegion</a></div><div class="ttdeci">SpiltRegion</div><div class="ttdoc">矩形将平面区域分成9块</div><div class="ttdef"><b>Definition:</b> Rectangle.h:41</div></div>
<div class="ttc" id="aclass_rectangle_html_a7280e33fa98d1d19f04020dacedddc5e"><div class="ttname"><a href="class_rectangle.html#a7280e33fa98d1d19f04020dacedddc5e">Rectangle::hasOverlapWith</a></div><div class="ttdeci">bool hasOverlapWith(const Rectangle &amp;other) const</div><div class="ttdoc">与另一个矩形有重叠部分</div><div class="ttdef"><b>Definition:</b> Rectangle.cpp:50</div></div>
<div class="ttc" id="aclass_rectangle_html_a87f41c3f204a8977f9f7556b1816a5fa"><div class="ttname"><a href="class_rectangle.html#a87f41c3f204a8977f9f7556b1816a5fa">Rectangle::Rectangle</a></div><div class="ttdeci">Rectangle(const Point &amp;lower_left, double width, double height)</div><div class="ttdoc">根据左下角和宽高创建矩形</div><div class="ttdef"><b>Definition:</b> Rectangle.cpp:7</div></div>
<div class="ttc" id="aclass_rectangle_html_adceaf832dba90e2fd4b08e7ba6aadef5"><div class="ttname"><a href="class_rectangle.html#adceaf832dba90e2fd4b08e7ba6aadef5">Rectangle::getPointRegion</a></div><div class="ttdeci">SpiltRegion getPointRegion(const Point &amp;pos) const</div><div class="ttdoc">获取点所在矩形的区域，在矩形上时返回INSIDE</div><div class="ttdef"><b>Definition:</b> Rectangle.cpp:22</div></div>
<div class="ttc" id="aclass_rectangle_html_ae2fb8da7f67a36a80d8f789eec63a074"><div class="ttname"><a href="class_rectangle.html#ae2fb8da7f67a36a80d8f789eec63a074">Rectangle::getHeight</a></div><div class="ttdeci">double getHeight() const</div><div class="ttdoc">获取矩形高度</div><div class="ttdef"><b>Definition:</b> Rectangle.cpp:18</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
